package com.yun.many.auth.model.translator;

import com.yun.many.auth.dao.entity.Role;
import com.yun.many.auth.dao.enums.StatusEnum;
import com.yun.many.auth.model.req.RoleEditReq;

public class RoleTranslator {

    public static Role toEntity(RoleEditReq req) {
        Role role = new Role();
        role.setId(req.getId());
        role.setName(req.getName());
        role.setRemark(req.getRemark());
        role.setStatus(StatusEnum.of(req.getStatus()));
        return role;
    }
}
